<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>联系人地址管理</title>
    <s:head/>
</head>
<script type="text/javascript">
    var formSetting = {
        title: "查询联系人地址信息",
        module: "query",
        numCount: 4,
        columms: [{}],
        buttons: {
            custom: [
                {
                    id: "addbtn",
                    value: "新增",
                    click: function () {
                        //$('#center', window.parent.document).attr("src","storageInfo-manage");
                        window.location.href = "contacter-manage";
                    }
                },
                {
                    id: "updateBtn",
                    value: "修改",
                    click: function () {
                        var id = $("#contacterDataGrid").jqGrid("getGridParam", "selrow");
                        if (id) {
                            //$('#center', window.parent.document).attr(
                            //	"src", "storageInfo-manage?storageInfo.id=" + id);
                            window.location.href = "contacter-manage?contacter.id=" + id;
                        } else {
                            alert("请点击需要修改的数据!");
                        }
                    }
                }
            ]
        },
        grid: {
            id: "contacterDataGrid",
            title: "查询结果",
            url: "contacter-findList",
            colModel: [{
                index: "id",
                name: "id",
                hidden: true
            }, {
                index: "ownerId",
                name: "owner.id",
                label: "联系人归属",
                hidden: true
            }, {
                index: "company",
                name: "company",
                label: "公司名称"
            }, {
                index: "city",
                name: "city",
                label: "市"
            }, {
                index: "area",
                name: "area",
                label: "区"
            }, {
                index: "town",
                name: "town",
                label: "街道"
            }, {
                index: "address",
                name: "address",
                label: "联系地址"
            }, {
                index: "name",
                name: "name",
                label: "姓名"
            }, {
                index: "phone",
                name: "phone",
                label: "联系电话"
            }],
            sortorder: "desc",
            jsonReader: {
                root: "contacters"
            }
        }
    };
    $(document).ready(function () {
        $("#contacterDataTable").mrdForm(formSetting);
    });
</script>
<body>
<div id="contacterDataTable"></div>
</body>
</html>
